from pyecharts.charts import Line
from pyecharts.options import TitleOpts, LegendOpts, ToolboxOpts

# 折线图
line = Line()
# x轴
line.add_xaxis(["China", "USA", "UK"])
# y轴
line.add_yaxis("GDP", [10, 20, 30])

# 全局配置
line.set_global_opts(
    title_opts=TitleOpts(title="GDP Title", pos_left="center", pos_bottom="10%"),
    legend_opts=LegendOpts(is_show=True),
    toolbox_opts=ToolboxOpts(is_show=True)
)

# 生成图像
line.render()
